home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Shareware / Utilitare / magicutils / mgutil_340.exe / {app} / Skins / Notepad / SKIN.NSI < prev   
Text File  |  2003-08-16  |  5KB  |  232 lines

  1. ; skin.nsi
  2. ;
  3. ; This script is perhaps one of the simplest NSIs you can make. All of the
  4. ; optional settings are left to their default settings. The installer simply 
  5. ; prompts the user asking them where to install, and drops a copy of makensisw.exe
  6. ; there. 
  7.  
  8. ;--------------------------------
  9.  
  10. ; The name of the installer
  11. Name "Skin"
  12. Caption "Skin Install"
  13. ;Icon "..\contrib\Icons\normal-install.ico"
  14.  
  15. ; The file to write
  16. OutFile "notepad.exe"
  17. XPStyle on
  18.  
  19. ; The default installation directory
  20. ;InstallDir $PROGRAMFILES\Mgtweak
  21.  
  22. ; The text to prompt the user to enter a directory
  23. DirText "Please select your software path below (you will be able to proceed when software is detected):"
  24. DirShow hide
  25.  
  26. AutoCloseWindow true
  27. ; The text to prompt the user to enter a directory
  28. ;DirText "This will install the very simple example1 on your computer. Choose a directory"
  29.  
  30. ;--------------------------------
  31.  
  32. ; The stuff to install
  33. Section "" ;No components page, name is not important
  34.  
  35.   ; Set output path to the installation directory.
  36.   SetOutPath $INSTDIR\Skins\Test
  37.   
  38.   ; Put file there
  39.   File borders.bmp
  40.   File capbutton.bmp
  41.   File captionbar.bmp
  42.   File preview.bmp
  43.   File skin.ini
  44.  
  45.   IfFileExists $INSTDIR\mgtweak.exe mgtweak
  46.   IfFileExists $INSTDIR\mgutil.exe mgutil
  47.   IfFileExists $INSTDIR\privacy.exe privacy
  48.   mgtweak:
  49.   WriteINIStr "$WINDIR\mgreg.ini"  "Settings" "skin" "Test"
  50.   Exec '"$INSTDIR\mgtweak.exe"'
  51.   mgutil:
  52.   WriteINIStr "$WINDIR\mgutil_reg.ini"  "Settings" "skin" "Test"
  53.   Exec '"$INSTDIR\mgutil.exe"'
  54.   privacy:
  55.   WriteINIStr "$WINDIR\privacy_reg.ini"  "Settings" "skin" "Test"
  56.   Exec '"$INSTDIR\privacy.exe"'
  57. SectionEnd ; end the section
  58.  
  59. ;------------------------------------------------------------
  60.  
  61. Function .onInit
  62. Call GetMagicTweakInstPath
  63. StrCmp $INSTDIR "" mgutilpath ExitInit
  64.     
  65. mgutilpath:
  66. Call GetMagicUtilInstPath
  67. StrCmp $INSTDIR "" privacypath ExitInit
  68.     
  69. privacypath:
  70. Call GetPrivacyInsInstPath
  71. StrCmp $INSTDIR "" Init ExitInit
  72.     
  73. Init:
  74. StrCpy $INSTDIR $PROGRAMFILES\Mgtweak
  75. ExitInit:
  76. FunctionEnd
  77.  
  78. Function .onVerifyInstDir
  79.  
  80. !ifndef WINAMP_AUTOINSTALL
  81.  
  82.   ;Check for Program installation
  83.  
  84.   IfFileExists $INSTDIR\mgtweak.exe Good
  85.   IfFileExists $INSTDIR\mgutil.exe Good    
  86.   IfFileExists $INSTDIR\privacy.exe Good        
  87.     Abort
  88.   Good:
  89.  
  90. !endif ; WINAMP_AUTOINSTALL
  91.  
  92. FunctionEnd
  93.  
  94. Function GetMagicTweakInstPath
  95.  
  96.   Push $0
  97.   Push $1
  98.   Push $2
  99.   ReadRegStr $0 HKLM \
  100.      "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicTweak_is1" \ 
  101.      "UninstallString"
  102.   StrCmp $0 "" fin
  103.  
  104.     StrCpy $1 $0 1 0 ; get firstchar
  105.     StrCmp $1 '"' "" getparent 
  106.       ; if first char is ", let's remove "'s first.
  107.       StrCpy $0 $0 "" 1
  108.       StrCpy $1 0
  109.       rqloop:
  110.         StrCpy $2 $0 1 $1
  111.         StrCmp $2 '"' rqdone
  112.         StrCmp $2 "" rqdone
  113.         IntOp $1 $1 + 1
  114.         Goto rqloop
  115.       rqdone:
  116.       StrCpy $0 $0 $1
  117.     getparent:
  118.     ; the uninstall string goes to an EXE, let's get the directory.
  119.     StrCpy $1 -1
  120.     gploop:
  121.       StrCpy $2 $0 1 $1
  122.       StrCmp $2 "" gpexit
  123.       StrCmp $2 "\" gpexit
  124.       IntOp $1 $1 - 1
  125.       Goto gploop
  126.     gpexit:
  127.     StrCpy $0 $0 $1
  128.  
  129.     StrCmp $0 "" fin
  130.     IfFileExists $0\mgtweak.exe fin
  131.       StrCpy $0 ""
  132.   fin:
  133.   StrCpy $INSTDIR $0
  134.   Pop $2
  135.   Pop $1
  136.   Exch $0
  137.   
  138. FunctionEnd
  139.  
  140. Function GetMagicUtilInstPath
  141.  
  142.   Push $0
  143.   Push $1
  144.   Push $2
  145.   ReadRegStr $0 HKLM \
  146.      "Software\Microsoft\Windows\CurrentVersion\Uninstall\Magic Utilities 2003_is1" \ 
  147.      "UninstallString"
  148.   StrCmp $0 "" fin
  149.  
  150.     StrCpy $1 $0 1 0 ; get firstchar
  151.     StrCmp $1 '"' "" getparent 
  152.       ; if first char is ", let's remove "'s first.
  153.       StrCpy $0 $0 "" 1
  154.       StrCpy $1 0
  155.       rqloop:
  156.         StrCpy $2 $0 1 $1
  157.         StrCmp $2 '"' rqdone
  158.         StrCmp $2 "" rqdone
  159.         IntOp $1 $1 + 1
  160.         Goto rqloop
  161.       rqdone:
  162.       StrCpy $0 $0 $1
  163.     getparent:
  164.     ; the uninstall string goes to an EXE, let's get the directory.
  165.     StrCpy $1 -1
  166.     gploop:
  167.       StrCpy $2 $0 1 $1
  168.       StrCmp $2 "" gpexit
  169.       StrCmp $2 "\" gpexit
  170.       IntOp $1 $1 - 1
  171.       Goto gploop
  172.     gpexit:
  173.     StrCpy $0 $0 $1
  174.  
  175.     StrCmp $0 "" fin
  176.     IfFileExists $0\mgutil.exe fin
  177.       StrCpy $0 ""
  178.   fin:
  179.   StrCpy $INSTDIR $0
  180.   Pop $2
  181.   Pop $1
  182.   Exch $0
  183.   
  184. FunctionEnd
  185.  
  186.  
  187.  
  188. Function GetPrivacyInsInstPath
  189.  
  190.   Push $0
  191.   Push $1
  192.   Push $2
  193.   ReadRegStr $0 HKLM \
  194.      "Software\Microsoft\Windows\CurrentVersion\Uninstall\Privacy Inspector_is1" \ 
  195.      "UninstallString"
  196.   StrCmp $0 "" fin
  197.  
  198.     StrCpy $1 $0 1 0 ; get firstchar
  199.     StrCmp $1 '"' "" getparent 
  200.       ; if first char is ", let's remove "'s first.
  201.       StrCpy $0 $0 "" 1
  202.       StrCpy $1 0
  203.       rqloop:
  204.         StrCpy $2 $0 1 $1
  205.         StrCmp $2 '"' rqdone
  206.         StrCmp $2 "" rqdone
  207.         IntOp $1 $1 + 1
  208.         Goto rqloop
  209.       rqdone:
  210.       StrCpy $0 $0 $1
  211.     getparent:
  212.     ; the uninstall string goes to an EXE, let's get the directory.
  213.     StrCpy $1 -1
  214.     gploop:
  215.       StrCpy $2 $0 1 $1
  216.       StrCmp $2 "" gpexit
  217.       StrCmp $2 "\" gpexit
  218.       IntOp $1 $1 - 1
  219.       Goto gploop
  220.     gpexit:
  221.     StrCpy $0 $0 $1
  222.  
  223.     StrCmp $0 "" fin
  224.     IfFileExists $0\privacy.exe fin
  225.       StrCpy $0 ""
  226.   fin:
  227.   StrCpy $INSTDIR $0
  228.   Pop $2
  229.   Pop $1
  230.   Exch $0
  231.   
  232. FunctionEnd